package com.nq.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.beans.ConstructorProperties;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Objects;

@TableName("user")
@Data
public class User {

    // 未设置
    public static final Integer SET_PAY_PWD_NO = 0;
    // 已设置
    public static final Integer SET_PAY_PWD_YES = 1;

    // 实名认证成功
    public static final Integer IS_ACTIVE_SUCCESS = 2;

    /**
     * 涨停板前缀
     */
    public static final String UP_BUY_PREFIX = "up_buy:";

    /**
     * 大宗股票
     */
    public static final String DZ_BUY_PREFIX = "dz_buy:";

    /**
     * 股票支付密码
     */
    public static final String PAY_PWD_PREFIX = "pay_pwd:";
    /**
     * 基金——支付密码
     */
    public static final String FUND_PAY_PWD_PREFIX = "fund_pay_pwd:";
    /**
     * 提现——支付密码
     */
    public static final String CASH_PAY_PWD_PREFIX = "cash_pay_pwd:";

    /**
     * 补充保证金——支付密码
     */
    public static final String SUPPLY_MARGIN_PWD_PREFIX = "cash_pay_pwd:";

    public static final int MAX_RETRY = 5; // 最多允许尝试的次数

    public static final int LOCK_TIME = 1800; // 锁定时间，秒为单位

    @TableId(type = IdType.AUTO,value = "id")
    private Integer id;
    private Integer agentId;
    private String agentName;
    private String code;
    private String phone;
    private String email;
    private String userPwd;
    private String withPwd;
    private String nickName;
    private String realName;
    private String idCard;
    private Integer accountType;
    // 表示用户的金额
    private BigDecimal userAmt;
    // 表示可用的金额
    private BigDecimal enableAmt;
    // 表示累计充值金额
    private BigDecimal sumChargeAmt;
    // 表示累计购买金额
    private BigDecimal sumBuyAmt;

    public void setId(Integer id) {
        this.id = id;
    }

    private String recomPhone;
    private Integer isLock;
    private Integer isLogin;
    // 注册时间
    private Date regTime;
    // 实名审核时间
    private Date auditTime;
    private String regIp;
    private String regAddress;
    private String img1Key;
    private String img2Key;
    private String img3Key;
    // 0 初始 1 提交审核 2 审核成功 3  审核拒绝
    private Integer isActive;
    private String authMsg;

    // 表示用户获取的佣金
    private BigDecimal userIndexAmt;
    // 表示可用的指数金额
    private BigDecimal enableIndexAmt;
    // 表示用户期货金额
    private BigDecimal userFutAmt;
    // 表示启用的期货金额  现在表示用户积分数量
    private BigDecimal enableFutAmt;
    // 表示提现密码
    private String withdrawalPwd;
    /*配资金额*/
    private BigDecimal tradingAmount;

    // 申购新股 - 冻结资金
    private BigDecimal djzj;
    //能否购买涨停板 0不能 1能
    private Integer isBuyUp;

    /**
     * 支付密码
     */
    private String payPwd;
    // 是否设置支付密码
    private Integer isPayPwd;

    /**
     * 国家
     */
    private String country;

    /**
     * 上级ID
     */
    private Integer parentId;

    @TableField(exist = false)
    private List<User> subUser;

    public String getWithdrawalPwd() {
        return withdrawalPwd;
    }

    public void setWithdrawalPwd(String withdrawalPwd) {
        this.withdrawalPwd = withdrawalPwd;
    }

    public void setAgentId(Integer agentId) {
        this.agentId = agentId;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setUserPwd(String userPwd) {
        this.userPwd = userPwd;
    }

    public void setWithPwd(String withPwd) {
        this.withPwd = withPwd;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public void setAccountType(Integer accountType) {
        this.accountType = accountType;
    }

    public void setUserAmt(BigDecimal userAmt) {
        this.userAmt = userAmt;
    }

    public void setEnableAmt(BigDecimal enableAmt) {
        this.enableAmt = enableAmt;
    }

    public void setSumChargeAmt(BigDecimal sumChargeAmt) {
        this.sumChargeAmt = sumChargeAmt;
    }

    public void setSumBuyAmt(BigDecimal sumBuyAmt) {
        this.sumBuyAmt = sumBuyAmt;
    }

    public void setRecomPhone(String recomPhone) {
        this.recomPhone = recomPhone;
    }

    public void setIsLock(Integer isLock) {
        this.isLock = isLock;
    }

    public void setIsLogin(Integer isLogin) {
        this.isLogin = isLogin;
    }

    public void setRegTime(Date regTime) {
        this.regTime = regTime;
    }

    public Date getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(Date auditTime) {
        this.auditTime = auditTime;
    }

    public void setRegIp(String regIp) {
        this.regIp = regIp;
    }

    public void setRegAddress(String regAddress) {
        this.regAddress = regAddress;
    }

    public void setImg1Key(String img1Key) {
        this.img1Key = img1Key;
    }

    public void setImg2Key(String img2Key) {
        this.img2Key = img2Key;
    }

    public void setImg3Key(String img3Key) {
        this.img3Key = img3Key;
    }

    public void setIsActive(Integer isActive) {
        this.isActive = isActive;
    }

    public void setAuthMsg(String authMsg) {
        this.authMsg = authMsg;
    }

    public void setUserIndexAmt(BigDecimal userIndexAmt) {
        this.userIndexAmt = userIndexAmt;
    }

    public void setEnableIndexAmt(BigDecimal enableIndexAmt) {
        this.enableIndexAmt = enableIndexAmt;
    }

    public void setUserFutAmt(BigDecimal userFutAmt) {
        this.userFutAmt = userFutAmt;
    }

    public void setEnableFutAmt(BigDecimal enableFutAmt) {
        this.enableFutAmt = enableFutAmt;
    }


    public Integer getIsPayPwd() {
        return isPayPwd;
    }

    public void setIsPayPwd(Integer isPayPwd) {
        this.isPayPwd = isPayPwd;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }


    public List<User> getSubUser() {
        return subUser;
    }

    public void setSubUser(List<User> subUser) {
        this.subUser = subUser;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return id.equals(user.id) && Objects.equals(agentId, user.agentId) && Objects.equals(agentName, user.agentName) && Objects.equals(code, user.code) && Objects.equals(phone, user.phone) && Objects.equals(email, user.email) && Objects.equals(userPwd, user.userPwd) && Objects.equals(withPwd, user.withPwd) && Objects.equals(nickName, user.nickName) && Objects.equals(realName, user.realName) && Objects.equals(idCard, user.idCard) && Objects.equals(accountType, user.accountType) && Objects.equals(userAmt, user.userAmt) && Objects.equals(enableAmt, user.enableAmt) && Objects.equals(sumChargeAmt, user.sumChargeAmt) && Objects.equals(sumBuyAmt, user.sumBuyAmt) && Objects.equals(recomPhone, user.recomPhone) && Objects.equals(isLock, user.isLock) && Objects.equals(isLogin, user.isLogin) && Objects.equals(regTime, user.regTime) && Objects.equals(auditTime, user.auditTime) && Objects.equals(regIp, user.regIp) && Objects.equals(regAddress, user.regAddress) && Objects.equals(img1Key, user.img1Key) && Objects.equals(img2Key, user.img2Key) && Objects.equals(img3Key, user.img3Key) && Objects.equals(isActive, user.isActive) && Objects.equals(authMsg, user.authMsg) && Objects.equals(userIndexAmt, user.userIndexAmt) && Objects.equals(enableIndexAmt, user.enableIndexAmt) && Objects.equals(userFutAmt, user.userFutAmt) && Objects.equals(enableFutAmt, user.enableFutAmt) && Objects.equals(withdrawalPwd, user.withdrawalPwd) && Objects.equals(tradingAmount, user.tradingAmount) && Objects.equals(djzj, user.djzj) && Objects.equals(isBuyUp, user.isBuyUp) && Objects.equals(payPwd, user.payPwd) && Objects.equals(isPayPwd, user.isPayPwd) && Objects.equals(country, user.country) && Objects.equals(parentId, user.parentId) && Objects.equals(subUser, user.subUser);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, agentId, agentName, code, phone, email, userPwd, withPwd, nickName, realName, idCard, accountType, userAmt, enableAmt, sumChargeAmt, sumBuyAmt, recomPhone, isLock, isLogin, regTime, auditTime, regIp, regAddress, img1Key, img2Key, img3Key, isActive, authMsg, userIndexAmt, enableIndexAmt, userFutAmt, enableFutAmt, withdrawalPwd, tradingAmount, djzj, isBuyUp, payPwd, isPayPwd, country, parentId, subUser);
    }

    protected boolean canEqual(Object other) {
        return other instanceof User;
    }

    public String toString() {
        return "User(id=" + getId() + ", agentId=" + getAgentId() + ", agentName=" + getAgentName() + ", phone=" + getPhone() + ", userPwd=" + getUserPwd() + ", withPwd=" + getWithPwd() + ", nickName=" + getNickName() + ", realName=" + getRealName() + ", idCard=" + getIdCard() + ", accountType=" + getAccountType() + ", userAmt=" + getUserAmt() + ", enableAmt=" + getEnableAmt() + ", sumChargeAmt=" + getSumChargeAmt() + ", sumBuyAmt=" + getSumBuyAmt() + ", recomPhone=" + getRecomPhone() + ", isLock=" + getIsLock() + ", isLogin=" + getIsLogin() + ", regTime=" + getRegTime() + ", regIp=" + getRegIp() + ", regAddress=" + getRegAddress() + ", img1Key=" + getImg1Key() + ", img2Key=" + getImg2Key() + ", img3Key=" + getImg3Key() + ", isActive=" + getIsActive() + ", authMsg=" + getAuthMsg() + ", userIndexAmt=" + getUserIndexAmt() + ", enableIndexAmt=" + getEnableIndexAmt() + ", userFutAmt=" + getUserFutAmt() + ", enableFutAmt=" + getEnableFutAmt() +", withdrawalPwd=" + getWithdrawalPwd() +", tradingAmount=" + getTradingAmount() +",djzj=" + getDjzj()+")";
    }

    public User() {
    }

    @ConstructorProperties({"id", "agentId", "agentName", "code", "phone", "userPwd", "withPwd", "nickName", "realName",
            "idCard", "accountType", "userAmt", "enableAmt", "sumChargeAmt", "sumBuyAmt", "recomPhone", "isLock", "isLogin",
            "regTime", "auditTime", "regIp", "regAddress", "img1Key", "img2Key", "img3Key", "isActive", "authMsg", "userIndexAmt", "enableIndexAmt",
            "userFutAmt", "enableFutAmt", "withdrawalPwd","tradingAmount","djzj","isBuyUp", "payPwd", "country", "parentId"})
    public User(Integer id, Integer agentId, String agentName, String code, String phone, String userPwd, String withPwd,
                String nickName, String realName, String idCard, Integer accountType, BigDecimal userAmt, BigDecimal enableAmt,
                BigDecimal sumChargeAmt, BigDecimal sumBuyAmt, String recomPhone, Integer isLock, Integer isLogin, Date regTime, Date auditTime,
                String regIp, String regAddress, String img1Key, String img2Key, String img3Key, Integer isActive, String authMsg,
                BigDecimal userIndexAmt, BigDecimal enableIndexAmt, BigDecimal userFutAmt, BigDecimal enableFutAmt, String withdrawalPwd,
                BigDecimal tradingAmount, BigDecimal djzj, Integer isBuyUp, String payPwd, String country, Integer parentId) {
        this.id = id;
        this.agentId = agentId;
        this.agentName = agentName;
        this.phone = phone;
        this.code = code;
        this.userPwd = userPwd;
        this.withPwd = withPwd;
        this.nickName = nickName;
        this.realName = realName;
        this.idCard = idCard;
        this.accountType = accountType;
        this.userAmt = userAmt;
        this.enableAmt = enableAmt;
        this.sumChargeAmt = sumChargeAmt;
        this.sumBuyAmt = sumBuyAmt;
        this.recomPhone = recomPhone;
        this.isLock = isLock;
        this.isLogin = isLogin;
        this.regTime = regTime;
        this.auditTime = auditTime;
        this.regIp = regIp;
        this.regAddress = regAddress;
        this.img1Key = img1Key;
        this.img2Key = img2Key;
        this.img3Key = img3Key;
        this.isActive = isActive;
        this.authMsg = authMsg;
        this.userIndexAmt = userIndexAmt;
        this.enableIndexAmt = enableIndexAmt;
        this.userFutAmt = userFutAmt;
        this.enableFutAmt = enableFutAmt;
        this.withdrawalPwd= withdrawalPwd;
        this.tradingAmount = tradingAmount;
        this.djzj = djzj;
        this.isBuyUp = isBuyUp;
        this.payPwd = payPwd;
        this.country = country;
        this.parentId = parentId;
    }


    public Integer getId() {
        return this.id;
    }


    public Integer getAgentId() {
        return this.agentId;
    }


    public String getAgentName() {
        return this.agentName;
    }


    public String getPhone() {
        return this.phone;
    }


    public String getUserPwd() {
        return this.userPwd;
    }


    public String getWithPwd() {
        return this.withPwd;
    }


    public String getNickName() {
        return this.nickName;
    }


    public String getRealName() {
        return this.realName;
    }


    public String getIdCard() {
        return this.idCard;
    }


    public Integer getAccountType() {
        return this.accountType;
    }


    public BigDecimal getUserAmt() {
        return this.userAmt;
    }


    public BigDecimal getEnableAmt() {
        return this.enableAmt;
    }


    public BigDecimal getSumChargeAmt() {
        return this.sumChargeAmt;
    }


    public BigDecimal getSumBuyAmt() {
        return this.sumBuyAmt;
    }


    public String getRecomPhone() {
        return this.recomPhone;
    }


    public Integer getIsLock() {
        return this.isLock;
    }


    public Integer getIsLogin() {
        return this.isLogin;
    }


    public Date getRegTime() {
        return this.regTime;
    }


    public String getRegIp() {
        return this.regIp;
    }


    public String getRegAddress() {
        return this.regAddress;
    }


    public String getImg1Key() {
        return this.img1Key;
    }


    public String getImg2Key() {
        return this.img2Key;
    }


    public String getImg3Key() {
        return this.img3Key;
    }


    public Integer getIsActive() {
        return this.isActive;
    }


    public String getAuthMsg() {
        return this.authMsg;
    }


    public BigDecimal getUserIndexAmt() {
        return this.userIndexAmt;
    }


    public BigDecimal getEnableIndexAmt() {
        return this.enableIndexAmt;
    }


    public BigDecimal getUserFutAmt() {
        return this.userFutAmt;
    }


    public BigDecimal getEnableFutAmt() {
        return this.enableFutAmt;
    }

    public BigDecimal getTradingAmount() {
        return tradingAmount;
    }

    public void setTradingAmount(BigDecimal tradingAmount) {
        this.tradingAmount = tradingAmount;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public BigDecimal getDjzj() {
        return djzj;
    }

    public void setDjzj(BigDecimal djzj) {
        this.djzj = djzj;
    }

    public Integer getIsBuyUp() {
        return isBuyUp;
    }

    public void setIsBuyUp(Integer isBuyUp) {
        this.isBuyUp = isBuyUp;
    }

    public String getPayPwd() {
        return payPwd;
    }

    public void setPayPwd(String payPwd) {
        this.payPwd = payPwd;
    }
}
